import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/pvm/student/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/pvm/student',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/pvm/student/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/pvm/student/' + id,
    method: 'delete'
  })
}

export function delBatchObj(ids) {
  return request({
    url: '/pvm/student/deleteList',
    method: 'post',
    data: ids
  })
}

export function putObj(obj) {
  return request({
    url: '/pvm/student',
    method: 'put',
    data: obj
  })
}

export function syncStudentInfo(schoolId) {
  return request({
    url: '/pvm/student/syncStudentInfo/' + schoolId,
    method: 'get',
  })
}

export function syncStudent(query) {
  return request({
    url: '/pvm/student/syncStudent',
    method: 'get',
    params: query
  })
}


export function printStudent(obj) {
  return request({
    url: '/pvm/student/printStudent',
    method: 'post',
    data: obj,
    responseType: 'blob'
  })
}

export function printOneStudent(obj) {
  return request({
    url: '/pvm/student/printOneStudent',
    method: 'post',
    data: obj,
    responseType: 'blob'
  })
}

// 转学
export function studentTransfer(id){
  return request({
    url: '/pvm/student/transfer/' + id,
    method: 'get'
  })
}

// 学生休学
export function studentSuspension(id){
  return request({
    url: '/pvm/student/suspend/' + id,
    method: 'get'
  })
}

// 停用学生
export function studentStop(id){
  return request({
    url: '/pvm/student/disable/' + id,
    method: 'get'
  })
}